<?php

namespace App\Http\Middleware;

use Closure;

class adminview
{
    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @return mixed
     */
    public function handle($request, Closure $next)
    {
        //这里先设置is_admin为ture；然后在执行构造方法中的中间件。此时已经在request中定义了is_admin
        $request -> is_admin = true;
        return $next($request);
    }
}
